<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<title>위치조건 선택</title>
<link href="./css/form_condition.css" type="text/css" rel="stylesheet" />
<link href="./css/jquery-ui-1.8.6.custom.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="./js/util.js"></script>
<script type="text/javascript" src="./js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="./js/jquery-ui-1.8.6.custom.min.js"></script>
<script type="text/javascript" src="./js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript">
	var conn_time = null;	
	$('document').ready(function() {
		
		$.getJSON("get_location.php", function(data) {			
			$('#location').append("<option value=' '></option>");
			$('#location2').append("<option value=' '></option>");
			$.each(data.ap, function(ap, ap_info) {
				$('#location').append("<option value='" + ap_info.location + "'>" + ap_info.location + "</option>");				
			});
			$.each(data.gps, function(gps, gps_info){
				$('#location2').append("<option value='" + gps_info.location + "'>" + gps_info.location + "</option>");
			});
		});		
		
		//conn_time = $('#connect_time');
		//conn_time.datetimepicker();
		//conn_time.datetimepicker("option", "dateFormat", "yy-mm-dd");
	});
	
	function copy() {	
		var address = $('#location').val();	
		var address2 = $('#location2').val();
		opener.<?php echo $_GET['form_name'].'.'.$_GET['addr_field_name'].'.value = '?>address
		opener.<?php echo $_GET['form_name'].'.'.$_GET['addr_field_name2'].'.value = '?>address2		
		window.close();
	}
</script>
</head>
<body>
	<form id="connect_gate" method="post" action="connect_gate.php">		
		<fieldset>
			<legend>위치조건 설정</legend>
			<div>
				<label for="location" class="label">설문가능위치: </label>
				
					<label>실내</label>									
				<select id="location" name="location">
				</select>				
			</div>
			<div>
				<label for="location" class="label"> </label>
				<label>실외</label>									
				<select id="location2" name="location2">
				</select>
			</div>
		</fieldset>
		
		<div class="submit">
			<input type="button" value="새 위치등록" onclick=openPopup("register_location.php","insert",900,800)>
			<input type="button" value="확인" onclick="copy(' ');">			
		</div>
	</form>
</body>
</html>